package cn.tedu.storage.service;

import cn.tedu.storage.mapper.StorageMapper;
import cn.tedu.storage.tcc.StorageTccAction;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class StorageServiceImpl implements StorageService{
    @Resource
    private StorageTccAction tcc;

    @Override
    public void decrease(Long productId, Integer count) {
        //不直接减库存，而是冻结库存
        tcc.prepare(null, productId, count);
    }
}
